<script>
    function * generator(n){
        console.log(n);
        let a=yield 100;
        console.log(a);
        let d=yield 200;
        console.log(d);
        let g=yield 300;
        console.log(g);
    }

    const iterator=generator(888);
    console.log(iterator.next());
    console.log(iterator.next("abc"));
    console.log(iterator.next("def"));
    console.log(iterator.next("ghi"));
</script>